package cate.game.play.proce.stat;

import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass("统计项")
public class StatItem {

	@NoteField("行动者pid")
	public int actorPid;

	@NoteField("目标pid")
	public int targetPid;

	@NoteField("类型")
	public int type;

	@NoteField("变化值")
	public long value;

	public StatItem() {
	}

	public StatItem(int actorPid, int targetPid, int type, long value) {
		this.actorPid = actorPid;
		this.targetPid = targetPid;
		this.type = type;
		this.value = value;
	}

	public StatItem copy(){
		StatItem item = new StatItem();
		item.actorPid = actorPid;
		item.targetPid = targetPid;
		item.type = type;
		item.value = value;
		return item;
	}

	public boolean eq(StatItem stat) {
		if (this.actorPid != stat.actorPid) {
			return false;
		}
		if (this.targetPid != stat.targetPid) {
			return false;
		}
		if (this.type != stat.type) {
			return false;
		}
		return true;
	}

}
